<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function method01(status){
            //获取表格里的四个复选框
            var checkArray=document.getElementsByName('chk_id');
            //循环遍历，让每个复选框的选择状态与参数值一致
            for(var index=0;index<checkArray.length;index++){
                checkArray[index].checked=status;
            }
        }
        function method02(){
            //获取表格里的四个复选框
            var checkArray=document.getElementsByName('chk_id');
            //循环遍历，然后让选中状态取反
            for(var index=0;index<checkArray.length;index++){
                checkArray[index].checked=!checkArray[index].checked;
            }
        }
    </script>
</head>
<body style="font-size: 12px">
<form name="form01">
    <table width="500" border="0" align="center" cellspacing="1" cellpadding="0" bgcolor="#7fffd4">
        <tr bgcolor="#FFFFFF">
            <td height="22" colspan="5" align="left">商品信息查看</td>
        </tr>
        <tr align="center" class="white">
            <td height="22">选择</td>
            <td height="22">所属类别</td>
            <td height="22">商品名称</td>
            <td height="22">会员价</td>
            <td height="22">数量</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="22"><input name="chk_id" type="checkbox" id="chk_id01" value="1"></td>
            <td height="22">手机</td>
            <td height="22">P_L音乐手机</td>
            <td height="22">1980</td>
            <td height="22">200</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="22"><input name="chk_id" type="checkbox" id="chk_id02" value="2"></td>
            <td height="22"> 玻璃制品 </td>
            <td height="22"> 迷你水杯 </td>
            <td height="22"> 49 </td>
            <td height="22">500</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="22"><input name="chk_id" type="checkbox" id="chk_id03" value="3"></td>
            <td height="22"> 音响 </td>
            <td height="22"> CXO音响 </td>
            <td height="22"> 2070  </td>
            <td height="22">200</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="22"><input name="chk_id" type="checkbox" id="chk_id04" value="4"></td>
            <td height="22"> 休闲装 </td>
            <td height="22"> 休闲上衣 </td>
            <td height="22"> 195 </td>
            <td height="22">500</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="22" colspan="5" align="left">&nbsp;&nbsp; <input name="chk_all" type="checkbox" id="chk_all" value="checkbox" onclick="method01(this.checked)" >
                [全选/全不选]<input type="button" value="反选" onclick="method02()"/></td>
        </tr>

    </table>
</form>
</body>
</html>